package service.search;

import bean.search.PersonSearch;
import client.MnueClient;
import dao.search.PersonSearchDao;
import service.menu.PersonMenuService;

import java.sql.SQLException;
import java.text.ParseException;
import java.util.List;
import java.util.Scanner;

/**
 * 个人信息查询逻辑实现类
 * */
public class PersonSearchService {
    public void show() throws SQLException, ParseException {
        PersonSearchDao psd= new PersonSearchDao();
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入需要查询学生的学号：");
        int sNumber = scanner.nextInt();
        List<PersonSearch> listPersomSeaech =psd.personSearch(sNumber);
        for(PersonSearch personSearch : listPersomSeaech){
            System.out.println(personSearch);
        }
        System.out.println("输入0返回上一层菜单");
        int a = scanner.nextInt();
        if(0 == a){PersonMenuService pms = new PersonMenuService();
            pms.messageSys();
        }
    }


}
